package com.webchat.connect.messagequeue.consumer.rocketmq;

import com.webchat.connect.messagequeue.consumer.service.ChatNotifyConsumeService;
import com.webchat.connect.messagequeue.consumer.service.RedPacketNotifyConsumeService;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 当前对话消息队列，因为需要WebSocket或SSE服务端主动推送，为了解决分布式websocketsession及ssemetter共享问题，这里必须广播模式
 */
//@Component
//@RocketMQMessageListener(consumerGroup = "web_chat", topic = "queue_red_packet_notify", messageModel = MessageModel.BROADCASTING)
public class RedPacketNotifyRocketQueueConsumer implements RocketMQListener<String> {


//    @Autowired
//    private RedPacketNotifyConsumeService redPacketNotifyConsumeService;


    /**
     * 处理来自IM 对话相关消息
     *
     * @param message
     */
    @Override
    public void onMessage(String message) {

        // TODO

//        redPacketNotifyConsumeService.consume(message);
    }
}